package cn.blog.controller.back;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.blog.controller.BaseServlet;
import cn.blog.entity.origin.Article2;
import cn.blog.service.back.Artile2Service;

@WebServlet("/back/managearticle")
public class Managearticle extends BaseServlet {
	private List<Article2> artlst2;
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		//获取请求参数
		String account = req.getParameter("text");//博客账号
		String cla = req.getParameter("text");//文章类型名称
		Artile2Service as = new Artile2Service();
		Article2 a2 =(Article2) req.getSession().getAttribute("a2");
		List<Article2> artlst3 = as.getArticle(account, cla);//调用条件查询博客文章方法
		if(artlst3.size()==0){
			artlst3 = as.getArticleAll();//调用查询所有博客文章方法
		}
		req.setAttribute("artlst3", artlst3);
		
		
		forward("back/managearticle");
	}

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		
	}
	
}
